package com.ideaaedi.zoo.diy.artifact.apidoc.knife4j.properties.nested;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * java代码 与 文档中的字段类型映射
 */
@Data
public class FieldTypeMapping {
    
    @NotBlank(message = "类型不能为空")
    @Schema(description = "类型全类名", example = "java.time.LocalTime")
    private String type;
    
    @NotNull(message = "转换类型不能为空")
    @Schema(description = "转换类型", example = "string")
    @Pattern(regexp = "^string|number|integer|boolean$", message = "只能为string、number、integer、boolean")
    private String targetType;
    
    @Schema(description = "数据格式说明。 当不为空时，将在类型后面加上括号，并在括号里暂时此内容")
    private String format;
}
